Ic card, portable terminal, and portable electronic apparatus

ABSTRACT

An IC card includes a communication unit and a controller. The communication unit can communicate with one communication destination by a plurality of interfaces including a first interface and a second interface. The controller processes a command received by the communication unit, and makes the communication unit transmit a response to the command. In a case where the first interface becomes unavailable after the communication unit receives the command by the first interface until the communication unit transmits the response to the command, the controller makes the communication unit transmit a response containing discontinuation information indicating that the transmission of the response to the command received by the first interface is discontinued by the second interface.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional application of U.S. patent applicationNo. 14/848,689 filed Sep. 9, 2015, which is based upon and claims thebenefit of priority from Japanese Patent Application No. 2014-183089,filed on Sep. 9, 2014, and Japanese Patent Application No. 2014-183469,filed on Sep. 9, 2014; the entire content of which are incorporatedherein by reference.

FIELD

Embodiments disclosed herein relate generally to an IC card, a portableterminal, and a portable electronic apparatus.

BACKGROUND

In recent years, there has been known an IC card which includes aplurality of interfaces. The conventional IC card receives a commandthrough an interface, executes a process of the received command, andtransmits a response through the same interface as the interface thatreceived the command.

Even though the conventional IC card includes the plurality ofinterfaces, the plurality of interfaces is not effectively used.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example of a portable terminalof a first embodiment.

FIG. 2 is a block diagram illustrating an example of an IC card of thefirst embodiment.

FIG. 3 is a flowchart illustrating an example of an operation of the ICcard of the first embodiment.

FIG. 4 is a flowchart illustrating an example of a command process of acontact I/F of the first embodiment.

FIG. 5 is a flowchart illustrating an example of a command process of anSWP I/F of the first embodiment.

FIG. 6 is a sequence diagram illustrating an example of an operation ofthe IC card of the first embodiment.

FIG. 7 is a sequence diagram illustrating another example of anoperation of the IC card of the first embodiment.

FIG. 8 is a sequence diagram illustrating an example of an operation ofan IC card of a second embodiment.

FIG. 9 is a diagram illustrating a communication system of anembodiment.

FIG. 10 is a diagram illustrating an outline of an example of the ICcard of an embodiment.

FIG. 11 is a diagram illustrating an example of a hardware configurationof the IC card of an embodiment.

FIG. 12 is a diagram illustrating an example of a data format of an ATRof an embodiment.

FIG. 13 is a flowchart illustrating an example of a sequence of aprocess performed in a communication system of an embodiment.

DESCRIPTION OF EMBODIMENTS

A conventional IC card includes a plurality of interfaces, but does noteffectively use the plurality of interfaces. For example, in a casewhere an interface receiving a command becomes unavailable for somereasons, the conventional IC card is unable to inform the outside thatthe interface becomes unavailable, a result of a command process, orresponse data.

An IC card of an embodiment includes a communication unit and acontroller. The communication unit can communicate with onecommunication destination by a plurality of interfaces including a firstinterface and a second interface. The controller processes a commandreceived by the communication unit, and makes the communication unittransmit a response to the command. In a case where the first interfacebecomes unavailable after the communication unit receives the command bythe first interface until the communication unit transmits the responseto the command, the controller makes the communication unit transmit aresponse containing discontinuation information indicating that thetransmission of the response to the command received by the firstinterface is discontinued by the second interface.

According to this embodiment, in a case where the interface havingreceived the command becomes unavailable for some reasons, it ispossible to inform the outside that the interface becomes unavailable,the result of the command process, and the response data.

Hereinafter, an IC card, an IC module, and a portable terminal ofembodiments will be described with reference to the drawings.

First Embodiment

FIG. 1 is a block diagram illustrating an example of a portable terminal2 of a first embodiment.

As illustrated in FIG. 1, the portable terminal 2 includes a terminalcontroller 20 and a CLF (Contactless Front-End) 21. In addition, an ICcard 1 is connected to the portable terminal 2 to be detachably attachedthereto. Further, the IC card 1 and the portable terminal 2 form an ICcard system.

The portable terminal 2 is, for example, a portable phone or a PDA(Personal Digital Assistant).

The terminal controller 20 is, for example, a processor containing a CPU(Central Processing Unit), and integrally controls the portable terminal2. The terminal controller 20 communicates with the IC card 1 by aninterface of a contact-type IC card defined in “ISO/IEC 7816” forexample. In addition, the terminal controller 20 communicates with theIC card 1 through the CLF 21 by an interface of an SWP (Single WireProtocol) communication defined in “ETSI TS 102 613” for example. Theinterface of the SWP communication defined in “ETSI TS 102 613” will becalled an SWP I/F in the following description. In this way, theterminal controller 20 can communicate with the IC card 1 connected tothe terminal controller 20 by two interfaces.

The terminal controller 20 transmits a command (a process request) tothe IC card 1, and receives a response (a process response) as a resultof a command process which is a process for the command.

The CLF 21 communicates with the IC card 1 by the SWP I/F. In addition,the CLF 21 communicates with an external apparatus of the portableterminal 2 by a contactless communication, for example, an NFC (NearField Communication) or the like. For example, the CLF 21 converts thecontactless communication with the external apparatus of the portableterminal 2 into a communication through the SWP I/F, and controls thecommunication between the IC card 1 and the outside (for example, theexternal apparatus) of the portable terminal 2.

Further, the communication between the terminal controller 20 and the ICcard 1 through the SWP I/F may be performed, for example, through theCLF 21, or may be performed through an external apparatus using the SWPI/F and the contactless communication. In addition, in a case where thecommunication is performed using the SWP I/F and the contactlesscommunication, the external apparatus and the terminal controller 20 maycommunicate, for example, using a 3G system (a third generation mobilecommunication system), a wireless LAN (Local Area Network), a USB(Universal Serial Bus), or the like.

A coil 22 is connected to the CLF 21, and serves as an antenna used inthe contactless communication such as the NFC. The CLF 21 communicateswith the external apparatus by the contactless communication such as theNFC through the coil 22.

The IC card 1 is, for example, a SIM (Subscriber Identity Module) card,and includes an IC module 10. The IC card 1 is formed, for example, bymounting the IC module 10 on a plastic card substrate 4 (an example of acard body). In other words, the IC card 1 includes the card substrate 4and the IC module 10 embedded in the card substrate 4. In addition, theIC card 1 includes at least two interfaces of, for example, theinterface (which may be referred to as a contact I/F in the followingdescription) of the contact-type IC card defined in “ISO/IEC 7816”described above and the SWP I/F. In other words, the IC card 1 cancommunicate with the terminal controller 20 through a contact portion 3by at least two interfaces of the contact I/F and the SWP I/F.

For example, the IC card 1 receives the command (the process request)transmitted by the terminal controller 20 of the portable terminal 2through the contact portion 3, and performs the process (the commandprocess) corresponding to the received command. Then, the IC card 1transmits the response (the process response) obtained as a result ofthe command process to the portable terminal 2 through the contactportion 3.

The IC module 10 is sold in a type of COT (Chip On Tape) for example,and includes the contact portion 3 and an IC chip 100.

The contact portion 3 includes terminals of various types of signalsnecessary for the operation of the IC card 1. Details of the contactportion 3 will be described below with reference to FIG. 2.

The IC chip 100 is, for example, an LSI (Large Scale Integration)element such as a one-chip microprocessor.

FIG. 2 is a block diagram illustrating an example of the IC card 1 ofthis embodiment.

As illustrated in FIG. 2, the IC card 1 (the IC module 10) includes thecontact portion 3 and the IC chip 100. Further, the IC chip 100 includesa communication unit 11, a CPU 12, a data memory 13, a working memory14, and a program memory 15.

The contact portion 3 includes terminals C1 to C8. The terminal C1 is aVDD terminal to which a power source voltage VDD is supplied. Theterminal C5 is a GND terminal to which a reference potential GND(ground) of the power source is supplied. The terminal C2 is an RSTterminal to which a RST (reset) signal is supplied. The terminal C3 is aCLK terminal to which a CLK (clock) signal is supplied. The terminal C7is a serial data input/output terminal (SIO terminal) for the contactI/F.

The terminal C6 is a serial data input/output terminal (SWIO terminal)for the SWP I/F. The terminal C4 is an input/output terminal (D+terminal) of a D+ signal for a USB interface. The terminal C8 is aninput/output terminal (D− terminal) of a D− signal for the USBinterface.

In a case where the IC card 1 is mounted in the portable terminal 2, theRST terminal (the terminal C2), the CLK terminal (the terminal C3), andthe SIO terminal (the terminal C7) are connected to, for example, an I/O(input/output) port (not illustrated) of the terminal controller 20, andused for the contact I/F. In addition, the SWIO terminal (the terminalC6) is connected to the CLF 21, and used for the SWP I/F. In addition,the RST terminal (the terminal C2), the CLK terminal (the terminal C3),the SIO terminal (the terminal C7), and the SWIO terminal (the terminalC6) are connected to the communication unit 11 of the IC chip 100.

The communication unit 11 can communicate with the same communicationdestination by the plurality of interfaces (for example, two of thecontact I/F and the SWP I/F). Herein, the same communication destinationis, for example, the terminal controller 20 of the portable terminal 2.The communication unit 11 receives a command from the terminalcontroller 20 by the contact I/F for example, and outputs the receivedcommand to the CPU 12. In addition, the communication unit 11 acquires aresponse to the subject command from the CPU 12, and transmits theresponse to the terminal controller 20 by the contact I/F.

In addition, the communication unit 11 receives a command from theterminal controller 20 by the SWP I/F for example, and outputs thereceived command to the CPU 12. In addition, the communication unit 11acquires a response to the subject command from the CPU 12, andtransmits the response to the terminal controller 20 by the SWP I/F.

The communication unit 11 monitors an SIO signal of the SIO terminal andan SWIO signal of the SWIO terminal for example, and determines whetherthe contact I/F and the SWP I/F enter an unavailable state. For example,the unavailable state of the contact I/F is a state where an SIO signalline is disconnected for some reasons, and does not enter an H (high)logical state. In a case where the contact I/F or the SWP I/F enters theunavailable state, the communication unit 11 outputs informationindicating the situation to the CPU 12.

The data memory 13 is, for example, a rewritable nonvolatile memory unitsuch as an EEPROM, and stores data used in various processes of the ICcard 1.

The working memory 14 is, for example, a volatile memory unit such as anSRAM (Static RAM), and temporarily stores data used for variousprocesses of the IC card 1.

The program memory 15 is, for example, a nonvolatile memory unit such asa mask ROM, and stores a program for executing various processes of theIC card 1, and data such as a command table. Examples of the program forexecuting various processes include an operating system, an applicationprogram, and a program for executing various types of command processes.

The CPU 12 (an example of the controller) executes, for example, aprogram stored in the program memory 15 to perform various processes ofthe IC card 1. The CPU 12 processes the command received by thecommunication unit 11 and makes the communication unit 11 transmit aresponse to the subject command, for example. In addition, in a casewhere the communication unit 11 detects that the contact I/F or the SWPI/F enters the unavailable state, the CPU 12 makes the communicationunit 11 transmit a response containing discontinuation informationindicating that the transmission of a response to the command isdiscontinued, by an interface which is not unavailable.

In addition, for example, it is assumed that the contact I/F becomesunavailable after the communication unit 11 receives a command by thecontact I/F until the communication unit 11 transmits a response to thesubject command. In such a case, the CPU 12 makes the communication unit11 transmit a response containing the discontinuation informationindicating that the transmission of the response, by the contact I/F, tothe subject command is discontinued, by the SWP I/F different from thecontact I/F. Further, in a case where the contact I/F becomesunavailable, the CPU 12 stores the response to be transmitted(discontinuation response), for example, in a predetermined storage areaof the working memory 14.

For example, in a case where the contact I/F becomes unavailable, and acase where an arbitrary command is received by the SWP I/F, the CPU 12makes the communication unit 11 transmit a response containing thediscontinuation information as a response to the subject command processby the SWP I/F. Herein, the discontinuation information is a special SW(status bytes (SW1 and SW2)) indicating that the transmission of theresponse is discontinued. Further, the arbitrary command is any one ofthe plurality of commands supported by the IC card 1 except a specialcommand described below.

In addition, in a case where the arbitrary command received by the SWPI/F for example is normally ended in this case, the CPU 12 makes thecommunication unit 11 transmit a response containing the discontinuationinformation (the special SW) as a response to the subject commandprocess. In addition, for example, in a case where the arbitrary commandreceived by the SWP I/F is abnormally ended, the CPU 12 makes thecommunication unit 11 transmit an error response (a response containingthe SW indicating an error) to the subject command process, and does nottransmit the response containing the discontinuation information (thespecific SW).

In addition, in a case where the communication unit 11 receives thespecific command (a specific command) by the SWP I/F in such a statewhere the transmission of the response by the contact I/F isdiscontinued, the CPU 12 makes the communication unit 11 transmit aresponse containing the discontinued response by the SWP I/F. In otherwords, the CPU 12 makes the communication unit 11 transmit the responsecontaining the discontinuation response stored in the predeterminedstorage area of the working memory 14 according to the special commandby the SWP I/F. Herein, the special command is a command to request fortransmitting the discontinued response.

Further, the CPU 12 keeps on performing the process of transmitting theresponse containing the special SW to the above-mentioned arbitrarycommand until the special command is executed. In other words, the CPU12 stops transmitting the response containing the special SW by the SWPI/F after the special command is executed.

In addition, for example, the CPU 12 executes the same process as theabove-mentioned process after the communication unit 11 receives thecommand by the SWP I/F until the communication unit 11 transmits theresponse to the subject command even in a case where the SWP I/F becomesunavailable. In other words, the CPU 12 makes the communication unit 11transmit a response containing the discontinuation information (forexample, the special SW) indicating that the transmission of theresponse to the subject command by the SWP I/F is discontinued by thecontact I/F different from the SWP I/F. Further, in a case where the SWPI/F becomes unavailable, the CPU 12 stores the response to betransmitted (the discontinuation response), for example, in apredetermined storage area of the working memory 14.

For example, in a case where the SWP I/F becomes unavailable and thearbitrary command is received by the contact I/F as described above, theCPU 12 makes the communication unit 11 transmit the response containingthe special SW by the contact I/F as a response to the subject commandprocess.

In addition, for example, in a case where the arbitrary command receivedby the contact I/F is normally ended in this case, the CPU 12 makes thecommunication unit 11 transmit the response containing the special SW asthe response to the command process. In addition, for example, in a casewhere the arbitrary command received by the contact I/F is abnormallyended, the CPU 12 makes the communication unit 11 transmit the errorresponse (the response containing the SW indicating an error) to thecommand process, and makes the communication unit 11 not transmit theresponse containing the special SW.

In addition, in a case where the communication unit 11 receives thespecial command (a specific command) by the contact I/F in such a statewhere the transmission of the response by the SWP I/F is discontinued,the CPU 12 makes the communication unit 11 transmit the responsecontaining the discontinued response by the contact I/F. In other words,the CPU 12 makes the communication unit 11 transmit the responsecontaining the discontinuation response stored in the predeterminedstorage area of the working memory 14 according to the special commandby the contact I/F. Further, the CPU 12 keeps on performing the processof transmitting the response containing the specific SW to theabove-mentioned arbitrary command until the specific command isexecuted. In other words, the CPU 12 stops transmitting the responsecontaining the specific SW by the contact I/F after the specific commandis executed.

Next, the operation of the IC card 1 (the IC module 10) according tothis embodiment will be described with reference to the drawings.

FIG. 3 is a flowchart illustrating an example of the operation of the ICcard 1.

In FIG. 3, the IC card 1 first determines whether a command is receivedby the contact I/F (Step S101). In other words, the CPU 12 of the ICcard 1 determines whether the communication unit 11 receives a commandby the contact I/F. In a case where the communication unit 11 receives acommand by the contact I/F (Step S101: YES), the CPU 12 progresses theprocess to Step S102. In addition, in a case where the communicationunit 11 does not receive a command by the contact I/F (Step S101: NO),the CPU 12 progresses the process to Step S103.

In Step S102, the CPU 12 executes the command process corresponding tothe command received by the contact I/F. Further, details of the commandprocess corresponding to the command received by the contact I/F will bedescribed below with reference to FIG. 4. After the process of StepS102, the CPU 12 progresses the process to Step S103.

In addition, in Step S103, the CPU 12 determines whether a command isreceived by the SWP I/F. In other words, the CPU 12 of the IC card 1determines whether the communication unit 11 receives a command by theSWP I/F. In a case where the communication unit 11 receives a command bythe SWP I/F (Step S103: YES), the CPU 12 progresses the process to StepS104. In addition, in a case where the communication unit 11 does notreceive a command by the SWP I/F (Step S103: NO), the CPU 12 returns theprocess to Step S101.

In Step S104, the CPU 12 executes the command process corresponding tothe command received by the SWP I/F. Further, details of the commandprocess corresponding to the command received by the SWP I/F will bedescribed below with reference to FIG. 5. After the process of StepS104, the CPU 12 returns the process to Step S101.

Next, the command process corresponding to the command received by thecontact I/F of Step S102 described above will be described withreference to FIG. 4.

FIG. 4 is a flowchart illustrating an example of the command processcorresponding to the command received by the contact I/F of thisembodiment.

In FIG. 4, first, the CPU 12 determines whether the received command isa special command (Step S201). In a case where the received command is aspecial command (Step S201: YES), the CPU 12 progresses the process toStep S207. In addition, in a case where the received command is not aspecial command (Step S201: NO), the CPU 12 progresses the process toStep S202.

In Step S202, the CPU 12 executes the command process. In other words,the CPU 12 executes the command process corresponding to the commandreceived by the communication unit 11.

Next, the CPU 12 determines whether the executed command process isnormally ended (Step S203). In a case where the executed command processis normally ended (Step S203: YES), the CPU 12 progresses the process toStep S204. In addition, in a case where the executed command process isnot normally ended (Step S203: NO), the CPU 12 progresses the process toStep S209.

In Step S204, the CPU 12 determines whether there is a discontinuationresponse which has not been transmittable by the SWP I/F. The CPU 12determines, for example, whether the discontinuation response is storedin a predetermined storage area of the working memory 14 so as todetermine whether there is the discontinuation response by the SWP I/F.In a case where there is the discontinuation response by the SWP I/F(Step S204: YES), the CPU 12 progresses the process to Step S205. Inaddition, in a case where there is no discontinuation response by theSWP I/F (Step S204: NO), the CPU 12 progresses the process to Step S206.

In Step S205, the CPU 12 makes the communication unit 11 transmit theresponse containing the special SW. In other words, the CPU 12 replacesthe normal SW indicating the normal ending among the responses to thecommand received by the contact I/F with the special SW, and makes thecommunication unit 11 transmit the response containing the special SW bythe contact I/F. After the process of Step S205, the CPU 12 progressesthe process to Step S210.

In addition, in Step S206, the CPU 12 makes the communication unit 11transmit the normal response. In other words, the CPU 12 makes thecommunication unit 11 transmit the normal response (the responsecontaining the normal SW) by the contact I/F, which indicates a normalending response to the command received by the contact I/F. After theprocess of Step S206, the CPU 12 progresses the process to Step S210.

In addition, in Step S207, the CPU 12 determines whether there is thediscontinuation response by the SWP I/F. For example, the CPU 12determines whether the discontinuation response is stored in thepredetermined storage area of the working memory 14 so as to determinewhether there is the discontinuation response by the SWP I/F. In a casewhere there is the discontinuation response by the SWP I/F (Step S207:YES), the CPU 12 progresses the process to Step S208. In addition, in acase where there is no discontinuation response by the SWP I/F (StepS207: NO), the CPU 12 progresses the process to Step S209.

In Step S208, the CPU 12 makes the communication unit 11 transmit thediscontinuation response. In other words, the CPU 12 makes thecommunication unit 11 transmit a response containing the discontinuationresponse by the contact I/F with respect to the special command receivedby the contact I/F, and removes discontinuation response informationfrom the working memory 14. The CPU 12 clears, for example, thediscontinuation response information stored in the predetermined storagearea of the working memory 14. After the process of Step S208, the CPU12 progresses the process to Step S210.

In addition, in Step S209, the CPU 12 makes the communication unit 11transmit the error response. In other words, the CPU 12 makes thecommunication unit 11 transmit the error response (the responsecontaining the SW indicating an abnormal ending) by the contact I/F,which indicates an abnormal ending response to the command received bythe contact I/F. After the process of Step S209, the CPU 12 progressesthe process to Step S210.

In Step S210, the CPU 12 determines whether transmission of a responseby the contact I/F can be available. In other words, the CPU 12determines whether the communication unit 11 detects that the contactI/F is unavailable. In a case where the transmission of the response bythe contact I/F is unavailable (Step S210: NO), the CPU 12 determinesthat the transmission of the response is discontinued, and progressesthe process to Step S211. In addition, in a case where the transmissionof the response by the contact I/F is available (Step S210: YES), theCPU 12 determines that the transmission of the response is normallyended, and ends the command process corresponding to the commandreceived by the contact I/F.

In Step S211, the CPU 12 stores the discontinuation response in theworking memory 14. In other words, the CPU 12 stores the discontinuationresponse in a predetermined storage area of the working memory 14, andends the command process corresponding to the command received by thecontact I/F.

Next, the command process corresponding to the command received by theSWP I/F of Step S104 described above will be described with reference toFIG. 5.

FIG. 5 is a flowchart illustrating an example of the command processcorresponding to the command received by the SWP I/F of this embodiment.

The command processes corresponding to the command received by the SWPI/F in Steps S301 to S311 illustrated in FIG. 5 are basically similar tothe processes in Steps S201 to S211 illustrated in FIG. 4 except thatthe SWP I/F is used instead of the contact I/F.

Further, in FIG. 5, the processes of Steps S304 and S307 are replacedwith the process of determining whether there is the discontinuationresponse which has not been transmittable by the contact I/F. Inaddition, the process of Step S310 is replaced with the process ofdetermining whether the response by the SWP I/F can be transmitted. Inthe other processes, the CPU 12 executes the processes as the processesof the SWP I/F.

Next, an example of the operation of the IC card 1 of this embodimentwill be described with reference to FIGS. 6 and 7.

FIG. 6 is a sequence diagram illustrating an example of the operation ofthe IC card 1 of this embodiment.

Further, in these drawings, the first interface of each of the IC card 1and the portable terminal 2 is assumed as the SWP I/F. The secondinterface is assumed as the contact I/F.

In FIG. 6, first, the terminal controller 20 of the portable terminal 2transmits a command to the IC card 1 by the SWP I/F of the portableterminal 2 (Step S401).

According to the command, the IC card 1 executes the command process(Step S402). In other words, the CPU 12 executes the command processcorresponding to the command received by the SWP I/F of the IC card 1.

In addition, the IC card 1 transmits the response obtained as a resultof the command process by the SWP I/F of the IC card 1 (Step S403). Inthis case, it is assumed herein that the SWP I/F of the IC card 1becomes unavailable for some reasons. Therefore, the CPU 12 records thediscontinuation response in a predetermined storage area of the workingmemory 14, indicating a response which has not been transmittable.

Next, the terminal controller 20 of the portable terminal 2 transmitsthe arbitrary command to the IC card 1 by the contact I/F of theportable terminal 2 (Step S404).

According to the command, the IC card 1 executes the command process(Step S405). In other words, the CPU 12 executes the command processcorresponding to the command received by the contact I/F of the IC card1.

In addition, the IC card 1 includes the special SW in a responseobtained as a result of the command process, and transmits the responseby the contact I/F of the IC card 1 (Step S406). Therefore, the terminalcontroller 20 detects that the SWP I/F of the IC card 1 is unavailable.

Next, the terminal controller 20 transmits the special command to the ICcard 1 by the contact I/F of the portable terminal 2 (Step S407).

According to the special command, the IC card 1 transmits the responsecontaining the discontinuation response (Step S408). In other words, theCPU 12 reads the discontinuation response from the predetermined storagearea of the working memory 14, and generates a response containing thediscontinuation response. The CPU 12 makes the communication unit 11transmit the response containing the discontinuation response by thecontact I/F of the IC card 1.

Therefore, the terminal controller 20 can acquire the discontinuationresponse obtained as a result of the command process which has beendiscontinued due to the unavailability of the SWP I/F of the IC card 1.

In addition, FIG. 7 is a sequence diagram illustrating another exampleof the operation of the IC card 1 of this embodiment. FIG. 7 illustratesan example in which the IC card 1 receives an arbitrary command by thecontact I/F of the IC card 1 during the period when the IC card 1executes the command process corresponding to the command received bythe SWP I/F of the IC card 1.

Further, in the drawing, similarly to FIG. 6, the first interface ofeach of the IC card 1 and the portable terminal 2 is assumed as the SWPI/F. The second interface is assumed as the contact I/F.

In FIG. 7, first, the terminal controller 20 of the portable terminal 2transmits a command to the IC card 1 by the SWP I/F of the portableterminal 2 (Step S501).

According to the command, the IC card 1 executes the command process(Step S502). In other words, the CPU 12 executes the command processcorresponding to the command received by the SWP I/F of the IC card 1.

In addition, during the command process, the terminal controller 20 ofthe portable terminal 2 transmits the arbitrary command to the IC card 1by the contact I/F of the portable terminal 2 (Step S503).

Next, the IC card 1 transmits, by the SWP I/F of the IC card 1, aresponse obtained as a result of the command process corresponding tothe command received by the SWP I/F of the IC card 1 (Step S504). Inthis case, the SWP I/F of the IC card 1 is assumed herein to becomeunavailable for some reasons. Therefore, the CPU 12 stores thediscontinuation response which has not been transmittable in apredetermined storage area of the working memory 14.

Next, the IC card 1 executes the command process according to thearbitrary command received by the contact I/F of the IC card 1 (StepS505). In other words, the CPU 12 executes the command processcorresponding to the command received by the contact I/F of the IC card1.

Next, the IC card 1 includes the special SW in a response obtained as aresult of the command process, and transmits the response containing thespecial SW by the contact I/F of the IC card 1 (Step S506). Therefore,the terminal controller 20 detects that the SWP I/F of the IC card 1 isunavailable.

Next, the terminal controller 20 transmits the special command to the ICcard 1 by the contact I/F of the portable terminal 2 (Step S507).

According to the special command, the IC card 1 transmits the responsecontaining the discontinuation response (Step S508). In other words, theCPU 12 reads the discontinuation response from the predetermined storagearea of the working memory 14, and generates a response containing thediscontinuation response. The CPU 12 makes the communication unit 11transmit the response containing the discontinuation response by thecontact I/F of the IC card 1.

Therefore, the terminal controller 20 can acquire the discontinuationresponse obtained as a result of the command process which has beendiscontinued due to the unavailability of the SWP I/F of the IC card 1.

The case where the SWP I/F of the IC card 1 becomes unavailable wasdescribed with reference to the examples illustrated in FIGS. 6 and 7.However, the operation in the case where the contact I/F of the IC card1 becomes unavailable is the same as those illustrated in FIGS. 6 and 7except that the SWP I/F is replaced with the contact I/F. In addition,in this case, the first interface is assumed as the contact I/F. Thesecond interface is assumed as the SWP I/F.

As described above, the IC card 1 according to this embodiment includesthe communication unit 11 and the CPU 12 (the controller). Thecommunication unit 11 can communicate with the same communicationdestination (for example, the portable terminal 2 (the terminalcontroller 20)) by the plurality of interfaces (for example, the contactI/F and the SWP I/F). The CPU 12 processes the command received by thecommunication unit 11, and makes the communication unit 11 transmit aresponse to the command. In addition, the CPU 12 makes the communicationunit 11 transmit a response containing the discontinuation information(for example, the special SW) by the second interface (for example, thecontact I/F) in a case where the first interface becomes unavailableafter the communication unit 11 receives the command by the firstinterface (for example, the SWP I/F) which is one of the plurality ofinterfaces until the communication unit transmits a response to thesubject command. Herein, the second interface is an interface differentfrom the first interface among the plurality of interfaces. In addition,the discontinuation information indicates that the transmission of theresponse to the subject command by the first interface is discontinued.

With this configuration, the communication destination (for example, theportable terminal 2 (the terminal controller 20)) of the IC card 1 candetect that the first interface of the IC card 1 becomes unavailable bythe response transmitted by the second interface of the IC card 1.Therefore, the IC card 1 according to this embodiment can performvarious processes, for example, the transmission of the special commandby the second interface. Accordingly, the IC card 1 according to thisembodiment can improve convenience.

In addition, in this embodiment, in a case where the first interface(for example, the SWP I/F) becomes unavailable and the arbitrary commandis received by the second interface (for example, the contact I/F), theCPU 12 makes the communication unit 11 transmit the response containingthe discontinuation information (for example, the special SW) by thesecond interface as a response to the subject command process. Further,herein, the description “the first interface (for example, the SWP I/F)becomes unavailable” indicates a case where the first interface becomesunavailable after the command is received by the first interface untilthe response to the subject command is transmitted.

Therefore, the communication destination (for example, the portableterminal 2 (the terminal controller 20)) of the IC card 1 can detectthat the first interface of the IC card 1 becomes unavailable bytransmitting the arbitrary command toward the second interface of the ICcard 1.

In addition, in a case where the first interface of the IC card 1 isreleased from its unavailability, the IC card 1 according to thisembodiment stops the transmission of the response containing thediscontinuation information (for example, the special SW). Therefore,the portable terminal 2 (the terminal controller 20) can detect that thefirst interface becomes unavailable by transmitting the arbitrarycommand toward the second interface of the IC card 1.

In addition, in this embodiment, in a case where the arbitrary commandis normally ended, the CPU 12 makes the communication unit 11 transmitthe response containing the discontinuation information (for example,the special SW) as a response to the subject command process.

Therefore, in a case where the arbitrary command is normally ended, theIC card 1 according to this embodiment can inform the discontinuation ofthe transmission of the response to the subject command by the firstinterface of the IC card 1 to the portable terminal 2 (the terminalcontroller 20) by the second interface of the IC card 1. In addition, ina case where the arbitrary command is abnormally ended, the CPU 12 makesthe communication unit 11 transmit the response containing the SWindicating the content of the abnormal ending. In other words, in a casewhere the arbitrary command is abnormally ended, the IC card 1 accordingto this embodiment can appropriately inform the content of the abnormalending to the portable terminal 2 (the terminal controller 20).

In addition, in this embodiment, in a case where the communication unit11 receives a specific command (for example, the special command) torequest for transmitting the discontinued response by the secondinterface of the IC card 1, the CPU 12 makes the communication unit 11transmit the discontinued response by the second interface of the ICcard 1.

Therefore, the portable terminal 2 (the terminal controller 20) canacquire the discontinuation response transmitted from the secondinterface of the IC card 1. Accordingly, the IC card 1 according to thisembodiment can more improve the convenience. In addition, in a casewhere the first interface of the IC card 1 becomes unavailable, the CPU12 uses the second interface of the IC card 1 to transmit the responseto the command received by the first interface, so that the IC card 1according to this embodiment can improve the reliability of datacommunication.

In addition, in this embodiment, the CPU 12 stops the transmission ofthe response containing the discontinuation information (for example,the special SW) by the second interface of the IC card 1 after aspecific command (for example, the special command) is executed.

Therefore, the IC card 1 according to this embodiment can prevent aresponse containing the discontinuation information (for example, thespecial SW) from being continued to be unnecessarily transmitted.

In addition, the IC module 10 according to this embodiment includes thecommunication unit 11 and the CPU 12 (the controller). The communicationunit 11 can communicate with the same communication destination (forexample, the portable terminal 2 (the terminal controller 20)) by theplurality of interfaces (for example, the contact I/F and the SWP I/F).The CPU 12 processes the command received by the communication unit 11,and makes the communication unit 11 transmit the response to the subjectcommand. In addition, the CPU 12 makes the communication unit 11transmit a response containing the discontinuation information (forexample, the special SW) by the second interface (for example, thecontact I/F) in a case where the first interface becomes unavailableafter the communication unit 11 receives the command by the firstinterface (for example, the SWP I/F) which is one of the plurality ofinterfaces until the communication unit transmits a response to thesubject command.

Therefore, the IC module 10 according to this embodiment can improve theconvenience similarly to the IC card 1.

In addition, the portable terminal 2 according to this embodimentincludes the terminal controller 20 that communicates with theabove-mentioned IC card 1 by the plurality of interfaces. In otherwords, the portable terminal 2 includes the contact I/F corresponding tothe contact I/F of the IC module 10 and the SWP I/F corresponding to theSWP I/F of the IC module 10.

The portable terminal 2 according to this embodiment can improve theconvenience similarly to the IC card 1 and the IC module 100.

Second Embodiment

Next, the IC module 10 and the IC card 1 according to a secondembodiment will be described with reference to the drawings.

In this embodiment, the description will be made about an example inwhich the IC card 1 does not transmit the response containing thespecial SW but transmits the discontinuation response by the specialcommand.

Further, the configurations of the IC card 1 and the portable terminal 2according to this embodiment are the same as those of the firstembodiment illustrated in FIGS. 1 and 2, and the description thereofwill not be repeated.

In addition, the operation of the IC card 1 according to this embodimentis the same as those illustrated in FIGS. 3, 4, and 5 except thefollowing point.

In the IC card 1 according to this embodiment, the CPU 12 executes theprocess of Step S206 without performing the processes of Steps S204 andS205 illustrated in FIG. 4. In addition, in the IC card 1 according tothis embodiment, the CPU 12 executes the process of Step S306 withoutperforming the processes of Steps S304 and S305 illustrated in FIG. 5.

In other words, in this embodiment, in a case where the first interfacebecomes unavailable with respect to the arbitrary command, the CPU 12does not perform the process in which the communication unit 11transmits the response containing the special SW by the secondinterface.

Next, an example of the operation of the IC card 1 of this embodimentwill be described with reference to FIG. 8.

FIG. 8 is a sequence diagram illustrating an example of the operation ofthe IC card 1 of this embodiment.

In FIG. 8, the first interface of each of the IC card 1 and the portableterminal 2 is assumed as the SWP I/F. The second interface is assumed asthe contact I/F.

In FIG. 8, first, the terminal controller 20 of the portable terminal 2transmits a command to the IC card 1 by the SWP I/F of the portableterminal 2 (Step S601).

According to the command, the IC card 1 executes the command process(Step S602). In other words, the CPU 12 executes the command processcorresponding to the command received by the SWP I/F of the C card 1.

In addition, the IC card 1 transmits a response obtained as a result ofthe command process by the SWP I/F of the IC card 1 (Step S603). In thiscase, it is assumed herein that the SWP I/F of the IC card 1 becomesunavailable for some reasons. Therefore, the CPU 12 stores thediscontinuation response which has not been transmittable, in apredetermined storage area of the working memory 14.

Herein, since the response from the IC card 1 is not receivable by theSWP I/F of the portable terminal 2, the terminal controller 20determines that there is a possibility that the SWP I/F of the IC card 1becomes unavailable for some reasons. Then, the terminal controller 20transmits the special command by the contact I/F of the portableterminal 2 to the IC card 1 (Step S604).

According to the special command, the IC card 1 transmits the responsecontaining the discontinuation response (Step S605). In other words, theCPU 12 reads the discontinuation response from the predetermined storagearea of the working memory 14, and generates the response containing thediscontinuation response. The CPU 12 makes the communication unit 11transmit the response containing the discontinuation response by thecontact I/F of the IC card 1.

Therefore, the terminal controller 20 can acquire the discontinuationresponse obtained as a result of the command process which has beendiscontinued due to the unavailability of the SWP I/F of the IC card 1.

Further, in the example illustrated in FIG. 8 above, the description hasbeen made about the case where the SWP I/F of the IC card 1 becomesunavailable. The operation in the case where the contact I/F of the ICcard 1 becomes unavailable is the same as that illustrated in FIG. 8except that the SWP I/F is changed into the contact I/F. In addition, inthis case, the first interface is assumed as the contact I/F. The secondinterface is assumed as the SWP I/F.

As described above, the IC card 1 and the IC module 10 according to thisembodiment include the communication unit 11 and the CPU 12 (thecontroller). The communication unit 11 can communicate with the samecommunication destination (for example, the portable terminal 2 (theterminal controller 20)) by the plurality of interfaces (for example,the contact I/F and the SWP I/F). The CPU 12 processes the commandreceived by the communication unit 11, and makes the communication unit11 transmit a response to the command. In addition, the CPU 12 makes thecommunication unit 11 transmit the response containing the responsediscontinued by the second interface (for example, the contact I/F) in astate where the communication unit 11 corresponds to the following case.In other words, the above-mentioned case is a case where the firstinterface becomes unavailable and the communication unit 11 is receivesa specific command by the second interface after the communication unit11 receives a command by the first interface until a response to thesubject command is transmitted. In addition, the specific command is acommand (for example, the special command) to require that thediscontinuation response to the command received by the first interfacebe transmitted.

Therefore, the portable terminal 2 (the terminal controller 20) canacquire the discontinuation response by the second interface.Accordingly, the IC card 1 and the IC module 10 according to thisembodiment can improve the convenience. In addition, in a case where thefirst interface becomes unavailable, the IC card 1 and the IC module 10according to this embodiment transmit, by the second interface, theresponse to the command received by the first interface, so that thereliability of the data communication can be improved.

In the above embodiments, the contact I/F and the SWP I/F included inthe IC card and the IC module have been exemplified as an interface.However, the interface is not limited to the above components. The aboveembodiments may employ, for example, the USB interface (the terminal C4and the terminal C8) as the interface other than the contact I/F and theSWP I/F, or may employ other interfaces.

In addition, the above embodiments may be applied to three or moreinterfaces.

In addition, the above embodiments have been described about an examplein which the data memory 13 is an EEPROM as a rewritable nonvolatilememory unit. However, the data memory 13 is not limited to the abovecomponent. For example, the data memory 13 may be a flash EEPROM, aFeRAM (Ferroelectric Random Access Memory) or the like instead of theEEPROM.

In addition, the above embodiments have been described about an examplein which the IC card 1 communicates with the portable terminal 2 throughthe contact portion 3. However, at least one of the interfaces may be acontactless interface which uses a coil or the like.

In addition, the above embodiments have been described about an examplein which the IC card 1 communicates with the portable terminal 2.However, the above embodiments may be applied to an example in which theIC card 1 communicates with a terminal apparatus having a stationaryreader/writer.

In addition, the above embodiments have been described about an examplein which the IC card 1 is a SIM card. However, the IC card 1 may be, forexample, an IC cash card or a credit card, or may be other types ofcards.

In addition, the above embodiments have been described about an examplein which the CPU 12 makes the communication unit 11 transmit theresponse containing the discontinuation response with respect to thespecial command, but the communication unit 11 may transmit thediscontinuation response without any change.

In addition, the first embodiment has been described about an example inwhich the IC card 1 transmits the response containing thediscontinuation information as a response containing the special SW, butthe invention is not limited thereto. For example, the IC card 1 mayinclude the discontinuation information in an ATR (Answer to Reset) andtransmit the ATR.

In addition, the first embodiment has been described about an example inwhich the CPU 12 makes the communication unit 11 transmit the responsecontaining the discontinuation response with respect to the specialcommand, but the process for the special command may be not included.

According to at least one of the above embodiments, the IC card 1 or theIC module 100 includes the communication unit 11 which can communicatewith the same communication destination by the plurality of interfaces(for example, the contact I/F and the SWP I/F), and the CPU 12 whichmakes the communication unit 11 perform a predetermined communication bythe second interface (for example, the contact I/F) in a case where thefirst interface becomes unavailable after the communication unit 11receives a command by the first interface (for example, the SWP I/F)until when a response to the command is received. Therefore, it ispossible to improve the convenience.

Third Embodiment

Examples of a manner of the communication between the IC card and anexternal terminal include a contact manner and a contactless manner. TheIC card provided with both of a contact interface and a contactlessinterface is called a combination card. Since a communication manner istransferred from the contact manner to the contactless manner, thecontact manner and the contactless manner are mixed.

When the combination card is inserted into a slot for contactcommunication of the terminal provided with both of the contactinterface and the contactless interface, the terminal performs anactivation process of the contact manner by priority on the combinationcard. The combination card does not have a function of giving a commandto switch the contact manner and the contactless manner to the terminal.Therefore, even though a contactless manner communication is performedspeedily more than the contact manner communication, the terminal may beunable to take advantage of the communication between the terminal andthe combination card.

Even though the plurality of interfaces is provided, the conventional ICcard does not effectively use the plurality of interfaces. For example,the conventional IC card and the terminal is unable to take advantage ofthe speedy communication.

According to this embodiment, the invention can provide a portableelectronic apparatus, an IC module, and a terminal which can takeadvantage of the contactless manner communication.

The portable electronic apparatus of this embodiment includes a mainbody in which an antenna is formed, and an IC module which is embeddedin the main body and includes a contact portion. The IC module includesa contact communication unit, a contactless communication unit, and acontroller. The contact communication unit communicates with theterminal in the contact manner using the contact portion. Thecontactless communication unit communicates with the terminal using theantenna in the contactless manner by a magnetic field generated from theterminal. In a case where the contactless communication unit receivesthe magnetic field when the contact communication unit communicates withthe terminal in the contact manner, the controller transmits informationon the contactless manner communication by the contactless communicationunit to the terminal by the contact communication unit.

According to the portable electronic apparatus, it is possible tocommunicate with the terminal at high speed.

Hereinafter, the portable electronic apparatus, the IC module, and theterminal of this embodiment will be described with reference to thedrawings.

FIG. 9 is a diagram illustrating a communication system 101 of thisembodiment.

The communication system 101 includes an IC card 111 and a terminal 112.The IC card 111 and the terminal 112 communicate with each other througha wired communication channel 113 or a wireless communication channel114.

The IC card 111 includes a contact communication unit 121, a contactlesscommunication unit 122, a switching unit 123, a storage unit 124, and acontroller 125.

The terminal 112 includes a contact communication unit 131, acontactless communication unit 132, a switching unit 133, a storage unit134, and a controller 135.

In this embodiment, the IC card 111 is configured to response only to acommand transmitted from the terminal 112. Further, as another exampleof the configuration, the IC card 111 may be configured to performoperations other than the response to the command transmitted from theterminal 112.

The IC card 111 will be described.

The IC card 111 interprets a command from an external terminal 12 andexecutes a process according to the command, and gives a response to theterminal 12 with the result of the process.

The IC card 111 includes one IC chip that is buried in the IC card 111.In the IC chip, the communication unit (the contact communication unit121 and the contactless communication unit 122), the switching unit 123,the storage unit 124, and the controller 125 are formed.

The contact communication unit 121 communicates with the contactcommunication unit 131 of the terminal 112 in the contact manner throughthe wired communication channel 113.

The contactless communication unit 122 communicates with the contactlesscommunication unit 132 of the terminal 112 in the contactless mannerthrough the wireless communication channel 114.

The switching unit 123 is controlled by the controller 125, and switchesthe communication unit used for the communication between the contactcommunication unit 121 and the contactless communication unit 122.

The storage unit 124 stores programs and various types of data in thearea thereof. The storage unit 124 includes, for example, a nonvolatileEEPROM (Electrically Erasable Programmable ROM) in which the storedcontent is rewritable, a RAM (Random Access Memory) in which data to beprocessed by the controller 125 is temporarily stored, and a ROM (ReadOnly Memory) in which a program executed by the controller 125 isstored. Further, various memories may be used as a memory storinginformation.

The controller 125 performs various types of processes and controls inthe IC card 111. The controller 125 includes a CPU (Central ProcessingUnit), executes a program stored in an area of the storage unit 124, andperforms various types of processes and controls. In this embodiment,the controller 125 controls the switching unit 123, and switches thecommunication unit used for the communication between the contactcommunication unit 121 and the contactless communication unit 122.

The terminal 112 will be described.

The terminal 112 is a read/write (R/W) terminal that communicates withthe IC card 111, and serves as an external terminal for the IC card 111.

The contact communication unit 131 communicates with the contactcommunication unit 121 of the IC card 111 in the contact manner throughthe wired communication channel 113.

The contactless communication unit 132 communicates with the contactlesscommunication unit 122 of the IC card 111 in the contactless mannerthrough the wireless communication channel 114.

The switching unit 133 is controlled by the controller 135, and switchesthe communication unit between the contact communication unit 131 andthe contactless communication unit 132.

The storage unit 134 stores programs and various types of data in thearea thereof. The storage unit 134 includes, for example, a nonvolatileEEPROM in which the stored content is rewritable, a RAM in which data tobe processed by the controller 135 is temporarily stored, and a ROM inwhich a program executed by the controller 35 is stored. Further,various memories may be used as a memory storing information.

The controller 135 performs various types of processes and controls inthe terminal 112. The controller 135 includes a CPU, executes a programstored in an area of the storage unit 134, and performs various types ofprocesses and controls. In this embodiment, the controller 135 controlsthe switching unit 133, and switches the communication unit used for thecommunication between the contact communication unit 131 and thecontactless communication unit 132.

Herein, the IC card 111 and the terminal 112 each include both of thecontact interface (the interface of the contact communication units 121and 131) and the contactless interface (the interface of the contactlesscommunication units 122 and 132). In this embodiment, the IC card 111 isthe combination card.

In the contact manner, the terminal 112 and the IC card 111 communicatewith each other in a state where a metal contact point provided in theterminal 112 and a metal contact point provided in the IC card 111 comein contact with each other. In this case, a conductive path (a wiredpath) connecting the terminal 112 and the IC card 111 which areconnected through the contact points becomes the wired communicationchannel 113. The terminal 112 includes a slot for the contactcommunication in which the metal contact points come in contact witheach other when the IC card 111 is inserted.

In the contactless manner, the terminal 112 and the IC card 111communicate with each other by electromagnetic induction between anantenna provided in the terminal 112 and an antenna provided in the ICcard 111. The antennas provided in the IC card 111 and the terminal 112are, for example, loop antennas. In this case, a path (wireless path) inthe air where the electromagnetic induction is performed becomes thewireless communication channel 114.

The terminal 12 transmits a command to the IC card 111 through a UART(Universal Asynchronous Receiver Transmitter) according to a specificprotocol in order to read and rewrite information stored in the IC card111. The IC card 111 secures, for example, the command received from theterminal 112 through the UART in a reception buffer, interprets thecommand secured in the reception buffer, and executes the processaccording to the command.

In addition, in this embodiment, the IC card 111 does not include apower source, and a configuration is used which supplies power from theterminal 112 to the IC card 111 in the contact manner or the contactlessmanner. As another example of the configuration, the IC card 111 mayinclude the power source.

FIG. 10 is a diagram illustrating an example of the outline of the ICcard 111 of an embodiment.

As illustrated in FIG. 10, the IC card 111 includes an IC module 151.The IC module 151 includes a contact portion 161, and an IC chip 162 isprovided therein. The IC card 111 is formed, for example, by mountingthe IC module 151 on a plastic card substrate 152 (an example of thecard body). In this way, the IC card 111 includes the card substrate 152and the IC module 51 which is embedded in the card substrate 152. Inaddition, the IC card 111 can communicate with the terminal 12 (anexternal apparatus) through the contact portion 161.

The IC card 111 receives, for example, the command (the process request)transmitted from the terminal 112 through the contact portion 161, andexecutes the process (the command process) according to the receivedcommand. Then, the IC card 111 transmits the response (the processresponse) obtained as a result of the command process to the terminal112 through the contact portion 161.

Herein, the terminal 112 is a host apparatus, for example, areader/writer, communicating with the IC card 111, and may be anotherapparatus.

The IC module 151 is sold, for example, in a type of COT (Chip On Tape)which is formed by arranging a plurality of the IC module 151 on a tape.

The contact portion 161 includes terminals of various signals necessaryfor the operation of the IC card 111. Herein, the terminals of varioussignals, for example, include terminals for receiving signals, such as apower source voltage, a clock signal, and a reset signal, supplied fromthe terminal 112, and the serial data input/output terminal (the SIOterminal) for communicating with the terminal 112. The terminalsreceiving the signals supplied from the terminal 112 include a powersource terminal (the VDD terminal and the GND terminal), a clock signalterminal (the CLK terminal), and a reset signal terminal (the RSTterminal).

The IC chip 162 is, for example, an LSI (Large Scale Integration)element such as a one-chip microprocessor.

In addition, as illustrated in FIG. 10, the IC card 111 includes anantenna 71. The antenna 171 is, for example, a loop antenna.

As described above, the IC card 111 can communicate with the terminal112 in the contact manner using the contact portion 161, and cancommunicate with the terminal 112 in the contactless manner using theantenna 171.

Further, FIG. 10 illustrates an example of the outline of the IC card11. The IC card 111 may include other circuits as needed.

In this way, the IC card 111 of this embodiment includes the cardsubstrate 152 in which the antenna 171 is provided, and the IC module151 which is embedded in the card substrate 152 and provided with the ICchip 162 and the contact portion 161.

In this embodiment, the IC module 151 includes the contact communicationunit 121, the contactless communication unit 122, the switching unit123, the storage unit 124, and the controller 25.

In this embodiment, the contact communication unit 121 performs thecommunication in the contact manner using the contact portion 161. Thecontactless communication unit 122 performs the communication in thecontactless manner using the antenna 71.

FIG. 11 illustrates an example of a hardware configuration of the ICcard 111 of an embodiment.

The IC card 111 includes a ROM 201, a RAM 202, an EEPROM 203, a contactcircuit 204, a contactless circuit 205, a switching circuit 206, a CPU207, a co-processor 208, and a system bus 209 that is used to connectthese components. In this embodiment, the RAM 202 is provided with areception buffer (not illustrated) in which the information of thecommand transmitted from the terminal 112 is secured. Further, the RAM202 may be provided with a transmission buffer in which the informationof the response transmitted to the terminal 112 is secured, and a workbuffer in which the information is secured when various works areperformed.

Herein, in the example of FIG. 11, the IC card 111 is provided with theco-processor 208 that executes a specific process (in this embodiment, aprocess of encrypting data, and a process of decrypting the encodeddata) for supporting the CPU 207. As another example of theconfiguration, all the processes may be executed by the CPU 207 withoutproviding the co-processor 208 in the IC card 111.

Further, in the example of FIGS. 9 and 11, the contact communicationunit 121 is realized by the function of the contact circuit 204. Thecontactless communication unit 122 is realized by the function of thecontactless circuit 205. The switching unit 123 is configured by thefunction of the switching circuit 206. The storage unit 124 is realizedby the functions of the ROM 201, the RAM 202, and the EEPROM 203. Thecontroller 25 is realized by the functions of the CPU 207 and theco-processor 208.

The switching between the contact manner communication and thecontactless manner communication in the IC card 111 will be described.As an example, a format of the command transmitted from the terminal 112to the IC card 111 and a format of the communication sequence aredefined in ISO/IEC 7816-3.

When the IC card 111 is activated in a defined setup sequence by thecontact interface provided in the terminal 12, the IC card 111 transmitsthe initial response ATR (Answer to Reset) to the terminal 112.

FIG. 12 illustrates an example of a data format of the ATR of anembodiment.

In the example of FIG. 12, the ATR contains an initial byte TS, a formatbyte T0, interface bytes TA(i), TB(i), TC(i), and TD(i) (herein, i=1, 2,3, . . . ), historical bytes T1 to Tk (herein, max k=15) related toinformation management, and a check parameter TCK. The data bytes T0 toTCK have 32 bytes at a maximum.

In this embodiment, the IC card 111 is, for example, manually insertedby a user into the slot for the contact communication of the terminal112 provided with both of the contact interface (the interface of thecontact communication unit 131) and the contactless interface (theinterface of the contactless communication unit 132). Then, the terminal112 makes the contact communication unit 131 activate the IC card 111through the contact interface. The terminal 112 makes the contactlesscommunication unit 132 generate a magnetic field for the communicationwith the IC card 111 in the contactless manner.

At this time, the controller 125 of the IC card 111 determines(confirms) whether the magnetic field generated by the terminal 112 isapplied to the contactless communication unit 122 (whether thecontactless communication unit 122 receives the magnetic field).

As a specific example, the IC card 111 contains an LSI (Large ScaleIntegration) element that includes a rectifying circuit in thecontactless communication unit 22. When the magnetic field generated bythe terminal 112 is applied, the rectifying circuit generates a voltageobtained by converting the magnetic field into a direct current (DC).Then, in a case where the controller 25 of the IC card 111 determinesthat the voltage generated by the rectifying circuit is equal to or morethan a predetermined threshold (or exceeding the predeterminedthreshold), the controller 125 determines that the magnetic fieldgenerated by the terminal 112 is applied to the contactlesscommunication unit 122. On the other hand, in the other case, thecontroller 125 of the IC card 111 determines that the magnetic fieldfrom the terminal of a communication partner in the contact manner isnot applied to the contactless communication unit 22 (for example, themagnetic field is not generated because the terminal of thecommunication partner in the contact manner has no contactlessinterface).

As a result of the above determination, when the IC card 111 isactivated by the terminal (for example, a terminal which includes thecontact interface but not the contactless interface) in the contactmanner, the controller 125 of the IC card 111 determines that themagnetic field from the terminal is not applied to the contactlesscommunication unit 122. In this case, the IC card 111 keeps oncommunicating with the terminal in the contact manner by the contactcommunication unit 121.

On the other hand, as a result of the above determination, when the ICcard 111 is activated by the terminal (for example, the terminal 112which includes both of the contact interface and the contactlessinterface), the controller 125 of the IC card 111 determines that themagnetic field from the terminal 112 is applied to the contactlesscommunication unit 22. In this case, the controller 125 of the IC card111 adds information about the contactless manner communication(contactless communication information) to the ATR to be transmitted tothe terminal 112 in the contact manner. The contactless communicationinformation is information which is sent from the IC card 111 to theterminal 112 to command the switching to the contactless mannercommunication. Various types of information may be employed as thecontactless communication information. The contactless communicationinformation contains, for example, information on the contents forcommanding the switching to the contactless manner communication. Thecontactless communication information may contain, as the information oranother information, information on the contents for informing thestandard of the contactless manner which is supported by the subjectapparatus (the IC card 111), or information on the contents fordesignating a standard of the contactless manner which is used by thesubject apparatus (the IC card 111), or the like. The IC card 111 addsthe contactless communication information to, for example, thehistorical data of the ATR to include the contactless communicationinformation in the historical data of the ATR.

When the controller 135 of the terminal 112 detects that the contactlesscommunication information is contained in the ATR received in thecontact manner from the IC card 111 activated in the contact manner, thecontroller 135 deactivates the IC card 111, which was activated in thecontact manner, in the contact manner, switches the interface to be usedfrom the contact interface to the contactless interface, activates theIC card 111 in the contactless manner, and starts the communication withthe IC card 111 in the contactless manner.

Herein, in a case where the controller 135 of the terminal 112 detectsthat the information such as the standard of the contactless manner iscontained in the contactless communication information received from theIC card 111, the terminal communicates with the IC card 111 in thecontactless manner matching with the standard for example.

Further, even though both of the contact interface and the contactlessinterface are provided, there may be a terminal which has no function ofswitching the communication from the contact manner to the contactlessmanner in accordance with the contactless communication informationbeing received from the IC card 111 in the contact communication. In acase where such a terminal is a communication partner in the contactcommunication, even when the IC card 111 transmits the contactlesscommunication information to the terminal, the terminal does not switchthe communication to the contactless manner. In this case, the IC card111 keeps on communicating with the terminal in the contact manner bythe contact communication unit 121.

For example, the standard of the contactless manner is ISO/IEC 14443TypeA/TypeB or FeliCa (registered trademark).

Herein, an example of the switching from the contact manner to thecontactless manner performed by the terminal 112 and the IC card 111 ofthis embodiment will be described.

The terminal 112 is set to turn on a function of activating the IC card111 by the contact communication unit 131 (for example, the powersupplied through an electric signal therefrom) and a function ofactivating the IC card 111 by the contactless communication unit 132(for example, the power supplied through the magnetic field therefrom).Then, the controller 135 of the terminal 112 controls the switching unit33 to switch the communication unit in order to use the communicationunit (the contact communication unit 131 or the contactlesscommunication unit 132) where the response from the IC card 111 isreceived for the communication. In addition, in a case where apredetermined command (a command to switch the communication from thecontact manner to the contactless manner) is received from the IC card111 when the terminal 112 communicates with the IC card 111 in thecontact manner, the controller 135 of the terminal 112 controls theswitching unit 133 to switch the communication unit in order to use thecontactless communication unit 132 for the communication.

In the IC card 111, in the initial state, the switching unit 123 iscontrolled to use the contact communication unit 21 for thecommunication. Then, in a case where the IC card 111 communicates withthe terminal 112 in the contact manner, the IC card 111 uses the contactcommunication unit 121 for the communication without any change. Inaddition, in a case where the IC card 111 communicates with the terminal112 in the contactless manner from the beginning not in the contactmanner, or in a case where the IC card 111 communicates with theterminal 112 in the contactless manner after communicating with theterminal in the contact manner, the controller 125 of the IC card 111controls the switching unit 123 to switch the communication unit inorder to use the contactless communication unit 122 for thecommunication.

FIG. 13 is a flowchart illustrating an example of a sequence of aprocess performed in the communication system 101 of an embodiment.

(Step S701)

When a user of the IC card 111 inserts the IC card 111 into the slot forthe contact communication of the terminal 112, the IC card 111 and theterminal 112 enter a state of communication enabled in the contactmanner. Then, the terminal 112 activates the IC card 111 by the contactinterface.

(Step S702)

When the contact communication of the contact communication unit 121 isactivated by the contact interface, the controller 125 of the IC card111 determines whether the contactless communication unit 122 receives amagnetic field (herein, the magnetic field in the contactless mannerfrom the terminal 112) from the outside.

As a result of the determination, in a case where it is determined thatthe magnetic field is received from the outside (YES), the IC card 111transfers the process to Step S703. In addition, in a case where it isdetermined that the magnetic field is not received from the outside(that is, a case where it is not determined that the magnetic field isreceived from the outside) (NO), the IC card 111 transfers the processto Step S707.

(Step S703)

In a case where it is determined that the magnetic field is receivedfrom the outside, the IC card 111 includes the contactless communicationinformation (information containing a command to switch thecommunication to the contactless interface) in the ATR which is theinitial response in the contact manner communication with the terminal12 by the controller 25. The ATR is transmitted to the terminal 12 inthe contact manner communication by the contact communication unit 21.

(Step S704)

Next, the terminal 112 receives the ATR transmitted from the IC card 111in the contact manner communication by the contact communication unit31. Then, in a case where the contactless communication information fromthe IC card 111 is contained in the ATR, the terminal 112 detects thecontactless communication information by the controller 135. Therefore,the terminal 112 deactivates the IC card 111 with respect to the contactinterface by the control of the controller 135. Thereafter, theswitching unit 133 performs the switching to activate the IC card 111 inthe contactless interface. In this case, the IC card 111 is deactivatedwith respect to the contact interface, and then activated with respectto the contactless interface. At this time, the IC card 111 iscontrolled by the controller 25 to be switched by the switching unit 123from a state of performing the communication by the contactcommunication unit 121 to a state of performing the communication by thecontactless communication unit 12. Then, the IC card 111 transfers theprocess to Step S705.

On the other hand, in a case where the terminal (for example, a terminalhaving no function of switching the communication from the contactmanner to the contactless manner) does not deactivate the IC card 111with respect to the contact interface so as not to activate the IC card111 in the contactless interface, the IC card 111 transfers the processto Step S708. Further, such a situation may occur, for example, even ina case where an error is issued in a switching process from the contactmanner to the contactless manner in the terminal 112.

(Step S705)

When the IC card 111 is activated by the contactless interface afterbeing deactivated with respect to the contact interface by the terminal112, the IC card 111 waits for a command transmitted from the terminal112 by the contactless interface.

(Step S706)

Then, the IC card 111 communicates with the terminal 112 in thecontactless manner by the contactless communication unit 22. Thereafter,the process of this flow is ended.

(Step S707)

In the process of Step S702, in a case where it is determined that themagnetic field is not received from the outside, the IC card 111transmits a normal ATR to the terminal 112 in the contact mannercommunication by the contact communication unit 121. Then, the IC card111 transfers the process to Step S708. Herein, the normal ATR is an ATRthat contains no contactless communication information.

(Step S708)

The IC card 111 waits to receive a command from the terminal 112established in the contact manner communication by the contact interfacewithout any change.

(Step S709)

The IC card 111 communicates with the terminal 112 in the contact mannerby the contact communication unit 121. Thereafter, the process of thisflow is ended.

In the embodiment described above, the IC card is used as an example ofthe portable electronic apparatus. With this regard, in another exampleof the configuration, as the portable electronic apparatus, varioustypes of portable electronic apparatuses such as an IC tag, a passporthaving an embedded IC, and a license having an embedded IC may beapplied instead of the IC card. A program (a program executable in acomputer) may be provided.

In the embodiment, the IC card 111 adds information (the contactlesscommunication information) related to the contactless mannercommunication to the ATR which is the initial response to the terminal112. With this regard, as another example of the configuration, the ICcard 111 may add the contactless communication information to a signalother than the ATR and transmit the signal to the terminal 112. As anexample, the terminal 112 may transmit a command to inquire aboutwhether the communication by the contactless manner to the IC card 111at a predetermined timing (for example, a periodic timing). The IC card111 may add the contactless communication information to a signal of theresponse to the command and transmit the signal to the terminal 112. Asanother example, when the IC card 111 communicates with the terminal 112in the contact manner, the IC card 111 may spontaneously transmit thesignal containing the contactless communication information to theterminal 12.

Further, as another example of the configuration, another communicationfunction using an LED (Light Emitting Diode) or the like (acommunication function other than the contact manner and the contactlessmanner in this embodiment) is provided in each of the IC card 111 andthe terminal 112. With the communication function, the signal containingthe contactless communication information may be transmitted from the ICcard 111 to the terminal 112.

According to the embodiment, the IC card 111 includes the IC module 151which is provided with the IC chip 152 and the contact portion 161, anda main body (in this embodiment, the card substrate 152) which isprovided with the antenna 171. The IC module 151 includes the contactcommunication unit 121 which communicates with the terminal 112 in thecontact manner using the contact portion 161, the contactlesscommunication unit 122 which communicates with the terminal 112 in thecontactless manner by the magnetic field generated from the terminal 112using the antenna 171, and the controller 125 which transmitsinformation related to the contactless manner communication by thecontactless communication unit 122 to the terminal 112 by the contactcommunication unit 121 in a case where the contactless communicationunit 122 receives the magnetic field when the contact communication unit121 communicates with the terminal 112 in the contact manner.

Therefore, by performing a command to switch the communication from thecontact manner to the contactless manner to the terminal 112 in the ICcard 111, it is possible to realize the switching from the contactmanner to the contactless manner in which the communication can be madeat high speed. In this embodiment, for example, in a case where a largecapacity of data is transmitted between the IC card 111 and the terminal112, a communication time can be shortened. In addition, in thisembodiment, for example, in a case where a communication error easilyoccurs due to a contact failure in the contact manner communicationbetween the IC card 111 and the terminal 112, it is possible to securestability in the communication by switching the communication from thecontact manner to the contactless manner. As a specific example, thecommunication system 101 according to this embodiment can be applied toa field where a large capacity of data are handled, such as atransponder of an electronic toll collection system (ETC) (ETCtransponder) or a system for handling biological data such as face dataor fingerprint data.

In this way, the IC card 111 of this embodiment can take advantage ofthe contactless manner communication.

According to the embodiment, in the IC card 111, the information relatedto the contactless manner communication by the contactless communicationunit 122 contains information (in this embodiment, information forspecifying the standard of the communication manner) for specifying thecommunication manner.

Therefore, the IC card 111 can indicate a communication manner (in thisembodiment, the standard of the communication manner) desired (or,corresponding thereto) by the IC card 111 itself with respect to theterminal 112.

According to the embodiment, in the IC card 111, the controller 125transmits the information related to the contactless mannercommunication by the contactless communication unit 22 as an initialresponse to the terminal 112.

Therefore, in the IC card 111, the command to switch the communicationto the contactless manner to the terminal 112 is performed at the stageof the initial response in the contact manner communication, so that itis possible to realize the switching to the contactless mannercommunication at the initial stage.

According to the embodiment, the IC module 151 includes the contactcommunication unit 121 which communicates with the terminal 112 in thecontact manner (using the contact portion 161), the contactlesscommunication unit 122 which communicates with the terminal 112 in thecontactless manner by the magnetic field generated from the terminal 112(using the antenna 171), and the controller 125 which transmits theinformation related to the contactless manner communication by thecontactless communication unit 122 to the terminal 112 by the contactcommunication unit 121 in a case where the contactless communicationunit 122 receives the magnetic field when the contact communication unit121 communicates with the terminal 112 in the contact manner.

Therefore, the IC module 151 of this embodiment can take advantage ofthe contactless manner communication.

According to the embodiment, the terminal 112 includes the contactcommunication unit 131 which communicates with the IC card 111 in thecontact manner, the contactless communication unit 132 which generatesthe magnetic field and communicates with the IC card 111 by the magneticfield in the contactless manner, and the controller 135 which controlsthe communication with the IC card 111 such that the contact mannercommunication by the contact communication unit 131 is stopped and thecontactless manner communication by the contactless communication unit132 is started in a case where the contact communication unit 131receives the information related to the contactless manner communicationfrom the IC card 111 when the contact communication unit 131communicates with the IC card 111 in the contact manner.

Therefore, the terminal 12 of this embodiment can take advantage of thecontactless manner communication.

According to this embodiment described above, the IC card 111 includesthe IC module 151 which is provided with the IC chip 152 and the contactportion 611 and a main body (in this embodiment, the card substrate 152)which is provided with the antenna 171. In addition, the IC module 151includes the contact communication unit 21 which communicates with theterminal 112 in the contact manner using the contact portion 161, thecontactless communication unit 122 which communicates with the terminal112 in the contactless manner by the magnetic field generated from theterminal 112 using the antenna 171, and the controller 125 whichtransmits the information related to the contactless mannercommunication by the contactless communication unit 122 to the terminal112 using the contact communication unit 121 in a case where thecontactless communication unit 122 receives the magnetic field when thecontact communication unit 121 communicates with the terminal 112 in thecontact manner. Therefore, the IC card 111 can take advantage of thecontactless manner communication.

The functions of the respective configurations in each apparatus (forexample, the IC card 1, the portable terminal 2, the IC card 111, andthe terminal 112) according to each embodiment described above may berealized by a program which is stored in a computer-readable recordingmedium. Therefore, the processes in the functions of each apparatus canbe performed by reading the program stored in the recording medium intothe computer and executing the program.

Further, herein, the expressing “reading the program stored in therecording medium into the computer and executing the program” includesinstallation of the program in a computer system. The “computer system”described herein may be a system containing an operating system (OS) ora hardware configuration such as peripheral devices.

In addition, the “computer system” may include a plurality of computerswhich are connected to each other through the Internet, a network suchas a WAN, a LAN, and a dedicated line. In addition, the“computer-readable recording medium” means a flexible disk, amagneto-optical disk, a ROM, a rewritable nonvolatile memory such as aflash memory, a portable medium such as a DVD (Digital Versatile Disk),and a memory device such as a hard disk built in the computer system.

Furthermore, the “computer-readable recording medium” includes arecording medium which stores the program for a predetermined timeperiod, for example, a volatile memory (for example, a dynamic randomaccess memory (DRAM)) in a client computer system or a servertransmitting the program through a communication line such as a network(the Internet) or a telephone line.

In addition, the program may be transferred from the computer systemhaving the program stored in the memory system toward another computersystem through a transmission medium or a transmission wave of thetransmission medium. Herein, the “transmission medium” which transfersthe program means a medium having a function of transferringinformation, like a network (communication network) such as the Internetor a communication line (communication wire) such as a telephone line.In addition, the program may be used to realize some of the functionsdescribed above. Furthermore, the program may be a so-calleddifferential file (differential program) which can realize theabove-mentioned functions by being combined with a program alreadystored in the computer system.

In this way, each functional unit may be a software functional unit or ahardware functional unit such as an LSI.

The invention has been described using some embodiments, but theseembodiments are given only as an example not intended to limit the scopeof the invention. These embodiments can be implemented in various forms,and omissions, replacements, and changes can be variously made in ascope not departing from the spirit of the invention. These embodimentsand modifications thereof are included in the scope and the spirit ofthe invention, and also included in a scope described in claims and theequivalents thereof.

What is claimed is:
 1. A portable electronic apparatus comprising: amain body that is provided with an antenna; and an IC module that isembedded in the main body and provided with a contact portion, whereinthe IC module includes a contact communication unit that communicateswith a terminal in a contact manner using the contact portion, acontactless communication unit that communicates with the terminal in acontactless manner using the antenna by a magnetic field generated fromthe terminal, and a controller that transmits information related to acontactless manner communication by the contactless communication unitto the terminal by the contact communication unit in a case where thecontactless communication unit receives the magnetic field when thecontact communication unit communicates with the terminal in the contactmanner.
 2. The portable electronic apparatus according to claim 10,wherein the information related to the contactless manner communicationby the contactless communication unit includes information forspecifying a communication manner.
 3. The portable electronic apparatusaccording to claim 10, wherein the controller transmits the informationrelated to the contactless manner communication by the contactlesscommunication unit as an initial response to the terminal.